package com.ddxz.demo.liquibase.mapper;

import com.ddxz.demo.liquibase.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * interface description
 *
 * @author 朱宗刚
 * @version 1.0.0
 * @date 2020/12/17
 */

@Mapper
@Repository
public interface TenantMapper {
    void createTenant(@Param("tenant") String tenant);

    void removeTenant(@Param("tenant") String tenant);

    List<String> getAllTenantNames();

    Integer saveDepartment(@Param("entity") DepartmentEntity entity, @Param("tenant") String tenant);

    Integer savePost(@Param("entity") PostEntity entity, @Param("tenant") String tenant);

    Integer saveRole(@Param("entity") RoleEntity entity, @Param("tenant") String code);

    Integer saveUser(@Param("entity") UserEntity entity, @Param("tenant") String code);

    Integer saveUserRoleRelation(@Param("entity") UserRoleEntity entity, @Param("tenant") String code);

    Integer saveTenant(@Param("entity") TenantEntity tenant, @Param("tenant") String code);
}
